package org.itworks.biodev.gui;

import java.util.*;

import org.itworks.biodev.model.*;
import org.itworks.helpers.*;

public class EditSubCategoryDialogModel extends Observable {
	private boolean isUpdating = false;
	private Vector<ProductCategory> productCategoriesList;
	private ProductSubCategory productSubCategory;
	
	public ProductSubCategory getProductSubCategory() {
		return this.productSubCategory;
	}
	
	public void setProductSubCategory(ProductSubCategory productSubCategory) {
		this.productSubCategory = productSubCategory;
		if(this.productSubCategory != null) {
			this.setChanged();
			this.notifyObservers(
				new MVCNotification(EditSubCategoryDialogView.SET_SUB_CATEGORY, productSubCategory)
			);
			this.clearChanged();
		}
	}
	
	public Vector<ProductCategory> getProductCategoriesList() {
		return this.productCategoriesList;
	}
	
	public void setProductCategoriesList(Vector<ProductCategory> productCategories) {
		this.productCategoriesList = productCategories;
		
		this.setChanged();
		this.notifyObservers(new MVCNotification(EditSubCategoryDialogView.FILL_COMBOBOX_CATEGORIES, productCategories));
		this.clearChanged();
	}
	
	public boolean getIsUpdating() {
		return this.isUpdating;
	}
	
	public void setIsUpdating(boolean isUpdating) {
		this.isUpdating = isUpdating;
	}
	
}
